package chunk.view;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Panel;
import java.util.ArrayList;

import chunk.control.GameManager;
import chunk.model.Box;
import chunk.model.Hero;

public class MyPanel extends Panel{

	private GameManager gameManager = null;
	private Hero hero = null;
	private ArrayList <Box> boxs = new ArrayList<Box>(); 
	
	
	
	public  MyPanel(GameManager gameManager){
		this.gameManager = gameManager;
		hero = new Hero(200, 200, 20, 20,8,Color.ORANGE, this.gameManager);
		
	

	}
	
	
	public void addBox(Box box){
		boxs.add(box);
	}
	


	public void paint(Graphics g) {
		
		super.paint(g);
		hero.drawSelf(g);
		
		for(int i = 0 ;i<boxs.size();i++){
			boxs.get(i).drawSelf(g);
		}
		
		
		
	}
	
	public Hero getHero() {
		return hero;
	}

	public void setHero(Hero hero) {
		this.hero = hero;
	}

}
